<template>
	<view>
		<!-- 仓库类型选择器 -->
		<u-picker :show="messageInfo.cklxshow" keyName="name" :columns="columns" @confirm="confirm" @cancel="cancel"></u-picker>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		name:"cangkulxpicker",
		props:{
			messageInfo:{
				cklxshow:false
			}
		},
		
		data() {
			return {
				columns: [],
			};
		},
		created(){
			this.init()
		},
		methods:{
			init(){
				httpRequest.request('/api/cc/ckItem', 'GET', {
				}, false, false, true).then(res => {
					if (res.code == 1) {
						this.columns.push(res.data)
					}
				})
			},
			confirm(e){
				let data = {
					name:e.value[0].name,
					id:e.value[0].id
				}
				this.$emit("surecklx",data)
				this.$parent.cklxshow = false
			},
			cancel(){
				this.$parent.cklxshow = false
			}
		}
	}
</script>

<style>

</style>